// "url": "http://plm.muxin.com:80/Windchill/servlet/rest/hzero/pmgt/taskbook/showTaskBookInfoTable",
import { request } from "@/utils/request";
let userinfo = JSON.parse(sessionStorage.getItem('userInfo'))
let userId = ''
let organizationId = 0;
if (userinfo) {
    organizationId = userinfo.tenantId
    userId = userinfo.loginName
}
//  获取项目对象的属性布局
export function getPanleForPipmgt(parameter) {
    return request({
      url: '/project/Windchill/servlet/rest/hzero/pdm/attribute/getPanleForPipmgt',
      method: 'post',
      data: parameter
    })
  }
 
// 获取流程处理的选择框属性
export function getPageSelectPrincipal(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getPageSelectPrincipal',
    method: 'post',
    data: parameter,
  })
}
// 创建/编辑问题
export function saveProjectIssue(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/issues/saveProjectIssue',
    method: 'post',
    data: parameter,
  })
}
//  删除问题记录
export function deleteProjectIssue(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/issues/deleteProjectIssue',
    method: 'post',
    data: parameter,
    // responseType: 'blob' //服务器返回的数据类型
  })
}
// // 项目问题列表表格
export function getProjectIssueList(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/issues/getProjectIssueList',
    method: 'post',
    data: parameter
  })
}
// 获取交付物名称
export function getDisplayIdentifier(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/getDisplayIdentifier',
    method: 'post',
    data: parameter,
  })
}
// 获取交付物流程节点（流程指引）
export function getProcessSteps(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getProcessSteps',
    method: 'post',
    data: parameter,
  })
}
// 获取交付物流程处理表格数据
export function getDisposeStatus(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getDisposeStatus',
    method: 'post',
    data: parameter,
  })
}
// 获取流程操作
export function getRouting(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getRouting',
    method: 'post',
    data: parameter,
  })
}
// 流程操作提交
export function completeWorkItem(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/completeWorkItem',
    method: 'post',
    data: parameter,
  })
}
// 流程操作提交--转办
export function reassignWorkItem(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/reassignWorkItem',
    method: 'post',
    data: parameter,
  })
}
//  导入问题模板
export function importIssues(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/issues/importIssues',
    method: 'post',
    data: parameter
  })
}
//  下载问题模板 
export function downQuetionTemplate(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/issues/downloadProjectIssue',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
//  导出问题模板 
export function exportTableData(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/project/exportTableData',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 获取问题附件信息
export function questionAttachmentInfo(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/getAttachmentInfo',
    method: 'post',
    data: parameter
  })
}
// 下载任务书附件
export function downloadAttachmentFile(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/downloadAttachmentFile',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 获取已选的流程审批人
export function getWFSelectPrincipal(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getWFSelectPrincipal',
    method: 'post',
    data: parameter,
  })
}
//  更新问题选择人
export function updateTeamPrincipal(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/pmgt/workflow/updateTeamPrincipal',
    method: 'post',
    data: parameter,
  })
}
//  问题确认上传附件带解决方案
export function addObjectAccessoryFile(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/issues/addObjectAccessoryFile',
    method: 'post',
    data: parameter,
  })
}
// 起草人身份操作
export function creatorMake(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/completeRunningWorkItemBySelf',
    method: "post",
    data: parameter,
  });
}
// QIS地址接口
export function getQisUrl(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/project/getQisUrl',
    method: "post",
    data: parameter,
  });
}